﻿using DtoFw.Enum;
using System;

namespace Domain.Base
{
    /// <summary>
    /// 实体类特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
    public class DBAttribute : Attribute
    {
        /// <summary>
        /// 数据库
        /// </summary>
        public EnumDatabase Database;

        /// <summary>
        /// 是否开启缓存
        /// </summary>
        public bool Cache;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="database">数据库</param>
        public DBAttribute(EnumDatabase database)
        {
            Database = database;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="database">数据库</param>
        /// <param name="cache">缓存</param>
        public DBAttribute(EnumDatabase database, bool cache)
        {
            Database = database;
            Cache = cache;
        }
    }
}
